]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyring: Cancel active prompts on disable()
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 27 Sep 2013 14:04:25 +0000 (16:04 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Wed, 9 Oct 2013 15:58:37 +0000 (17:58 +0200)
Since commit 1242a16265d5bf2, we will use a fake prompt which
cancels alls requests without dialog when the keyring component
is disabled. However this does only apply to new requests, dialogs
that are already active when the session mode changes are kept
open. This is not quite as expected, so cancel the prompt in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=708910

js/ui/components/keyring.js

index e02ae8f8ae2e46d2c502239f685e19cac97342e6..a5f5e1bdf68d6534f7db2c141ba32298b0464fb6 100644 (file)
@@ -246,11 +246,13 @@ const KeyringPrompter = new Lang.Class({
             function() {
                 let dialog = this._enabled ? new KeyringDialog()
                                            : new KeyringDummyDialog();
-                return dialog.prompt;
+                this._currentPrompt = dialog.prompt;
+                return this._currentPrompt;
             }));
         this._dbusId = null;
         this._registered = false;
         this._enabled = false;
+        this._currentPrompt = null;
     },
 
     enable: function() {
@@ -265,6 +267,10 @@ const KeyringPrompter = new Lang.Class({
 
     disable: function() {
         this._enabled = false;
+
+        if (this._prompter.prompting)
+            this._currentPrompt.cancel();
+        this._currentPrompt = null;
     }
 });